package com.itheima.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyAdvice {
    @Pointcut("execution(void com.itheima.dao.BookDao.update())")
    private void pt() {
    }
    //@Before("pt()")
    public void before() {
        System.out.println("before advice...");
    }

    //@After("pt()")
    public void after(){
        System.out.println("after advice...");
    }

    @Around("pt()")
    public void around(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("before advice...");
        joinPoint.proceed();
        System.out.println("after advice...");
    }
}
